﻿using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace _27_DDD.Models
{
    public class UserConfig : IEntityTypeConfiguration<User>
    {
        public void Configure(EntityTypeBuilder<User> builder)
        {
            builder.ToTable("T_Users");
            builder.Property("PasswordHash"); // 私有属性属性成员变量的映射到数据库
            builder.Property(p=>p.Remark).HasField("remark"); //只读不写
            builder.Ignore(p => p.Tag);
        }
    }
}
